﻿using System;
using Framework;
using UnityEngine;

namespace Game
{
    public class GCActionable : IBTreeActionable<SceneBTreeContext>
    {
        public void OnStart(SceneBTreeContext context)
        {
            GC.Collect();
            ResCache.RemoveUnused();
            Resources.UnloadUnusedAssets();
        }

        public void OnEnd(SceneBTreeContext context)
        {
        }

        public TaskStatus Update(SceneBTreeContext context)
        {
            return TaskStatus.Success;
        }
    }
}